package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.ConsultDynamicDetailVO;
import com.digitalchina.lxnsy.entity.ConsultDynamicListVO;
import com.digitalchina.lxnsy.toolkit.FrescoUtil;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2018/2/7 11:45:58
 * 修改备注：
 * ================================================
 */

public class ConsultDynamicDetailHolder extends BaseViewHolder<ConsultDynamicListVO.QuestionReplyInfoModels> {

    private SimpleDraweeView sdvHead;
    private TextView tvName;
    private TextView tvReplyNum;
    private TextView tvCommentNum;

    public ConsultDynamicDetailHolder(ViewGroup parent) {
        super(parent, R.layout.item_consult_dynamic_detail);

        sdvHead = $(R.id.iv_head);
        tvName = $(R.id.tv_name);
        tvReplyNum = $(R.id.tv_reply_num);
        tvCommentNum = $(R.id.tv_comment_num);
    }

    @Override
    public void setData(final ConsultDynamicListVO.QuestionReplyInfoModels data) {
        super.setData(data);

        if (data.subjectExpertInfo != null){
            FrescoUtil.showImageSmall(data.getSubjectExpertInfo().phone, sdvHead);
            tvName.setText(data.getSubjectExpertInfo().name + "");
        }

      //  tvReplyNum.setText(data.getReplyDate());
        tvCommentNum.setText(data.getReplyContent());
    }

}
